#include <iostream>
#include<queue>

using namespace std;


typedef long long ll;

priority_queue<int> heap;
int n, k;

int main()
{
	cin >> n >> k;
	ll sum = 0;
	while(n--)
	{
		int x;
		cin >> x;
		sum += x;
		if(x % 2 == 0)
		    heap.push(x);
	}
	while(heap.size() && k--)
	{
		int t = heap.top() / 2;
		heap.pop();
		sum -= t;
		if(t % 2 == 0)
		    heap.push(t);
	}
	cout << sum << endl;
	return 0;
}
